﻿using UnityEngine;
using System.Collections;

public class InputController : MonoBehaviour {

	// Components
	private PlayerController playerController;
	// Use this for initialization
	void Start () {
		playerController = GetComponent<PlayerController>();
	}
	
	// Update is called once per frame
	void Update () {
		playerController.horizontal = Input.GetAxisRaw("Horizontal");
		
		if(Input.GetButtonDown("Contextual")) {
			playerController.onContextual(true);
		}
		if(Input.GetButtonUp("Contextual")) {
			playerController.onContextual(false);
		}
		
		if (Input.GetButtonUp("Attack")) {
			playerController.onAttack();
		}
		
		if(Input.GetButtonUp("Jump")){
			playerController.onJump();
		}
		
		if (Input.GetButtonUp("Change")) {
			playerController.switchCharacter();
		}
	}
}
